
import { Controller, Get, Post, Body, Patch, Param, Delete, Query } from '@nestjs/common';
import { PaginationResult } from '../../common/interface/pagination.interface';
import { ApiTags } from '@nestjs/swagger';

import { AuthService } from './auth.service';
import { LoginAuthDto } from './dto/login-auth.dto';
import { ApiOperation } from '@nestjs/swagger';
import { Public } from './auth.decorator';


@ApiTags('auth')
@Controller('auth')
export class AuthController {
  constructor(private readonly service: AuthService) { }

  @Public()
  @Post('login')
  @ApiOperation({ summary: '登录账号' })
  async login(@Body() dto: LoginAuthDto) {
    return this.service.login(dto)
  }

  // @Get()
  // @ApiOperation({ summary: '获取auth列表' })
  // async findAll(@Query() query: QueryAuthDto): Promise<PaginationResult<AuthEntity>> {
  //   return this.service.findAll(query);
  // }

  // @Get(':id')
  // @ApiOperation({ summary: '根据ID获取auth' })
  // findOne(@Param('id') id: number) {
  //   return this.service.findOne(+id);
  // }

  // @Patch(':id')
  // @ApiOperation({ summary: '更新auth' })
  // update(@Param('id') id: number, @Body() updateDto: UpdateAuthDto) {
  //   return this.service.update(+id, updateDto);
  // }

  // @Delete(':id')
  // @ApiOperation({ summary: '删除auth' })
  // remove(@Param('id') id: number) {
  //   return this.service.remove(+id);
  // }
}
